package com.neulogistics.contrib.procuredcenter.infrastructure.persistence.converter;

import com.neulogistics.contrib.procuredcenter.domain.model.aggregate.GoodsSet;
import com.neulogistics.contrib.procuredcenter.infrastructure.persistence.orm.po.GoodsSetPO;
import org.springframework.beans.BeanUtils;

public class GoodsSetEntityPOConverter {
    public static GoodsSetPO entityToPO(GoodsSet goodsSet){
        if(goodsSet == null)
            return null;

        GoodsSetPO goodsSetPO = new GoodsSetPO();
        // 复制普通属性
        BeanUtils.copyProperties(goodsSet, goodsSetPO);

        return goodsSetPO;
    }

    public static GoodsSet POToEntity(GoodsSetPO goodsSetPO){
        if(goodsSetPO == null)
            return null;

        GoodsSet goodsSet = new GoodsSet();
        // 复制普通属性
        BeanUtils.copyProperties(goodsSetPO, goodsSet);

        return goodsSet;
    }
}
